<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "member".
 *
 * @property integer $member_id
 * @property string $member_name
 * @property string $member_truename
 * @property string $member_avatar
 * @property integer $member_sex
 * @property string $member_birthday
 * @property string $member_passwd
 * @property string $member_email
 * @property string $member_qq
 * @property string $member_ww
 * @property integer $member_login_num
 * @property string $member_time
 * @property string $member_login_time
 * @property string $member_old_login_time
 * @property string $member_login_ip
 * @property string $member_old_login_ip
 * @property string $member_qqopenid
 * @property string $member_qqinfo
 * @property string $member_sinaopenid
 * @property string $member_sinainfo
 * @property integer $member_points
 * @property string $available_predeposit
 * @property string $freeze_predeposit
 * @property integer $inform_allow
 * @property integer $is_buy
 * @property integer $is_allowtalk
 * @property integer $member_state
 * @property integer $member_credit
 * @property integer $member_snsvisitnum
 * @property integer $member_areaid
 * @property integer $member_cityid
 * @property integer $member_provinceid
 * @property string $member_areainfo
 * @property string $member_privacy
 */
class Member extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'member';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['member_name', 'member_passwd', 'member_email', 'member_time', 'member_login_time', 'member_old_login_time'], 'required'],
            [['member_sex', 'member_login_num', 'member_points', 'inform_allow', 'is_buy', 'is_allowtalk', 'member_state', 'member_credit', 'member_snsvisitnum', 'member_areaid', 'member_cityid', 'member_provinceid'], 'integer'],
            [['member_birthday'], 'safe'],
            [['member_qqinfo', 'member_sinainfo', 'member_privacy'], 'string'],
            [['available_predeposit', 'freeze_predeposit'], 'number'],
            [['member_name', 'member_avatar'], 'string', 'max' => 50],
            [['member_truename', 'member_login_ip', 'member_old_login_ip'], 'string', 'max' => 20],
            [['member_passwd'], 'string', 'max' => 32],
            [['member_email', 'member_qq', 'member_ww', 'member_qqopenid', 'member_sinaopenid'], 'string', 'max' => 100],
            [['member_time', 'member_login_time', 'member_old_login_time'], 'string', 'max' => 10],
            [['member_areainfo'], 'string', 'max' => 255],
            ['default', 'member_sex', 'value'=>2],
            ['default', 'member_email', 'value'=>''],
            ['default', 'member_login_time', 'value'=>time()],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'member_id' => '会员id',
            'member_name' => '会员名称',
            'member_truename' => '真实姓名',
            'member_avatar' => '会员头像',
            'member_sex' => '会员性别',
            'member_birthday' => '生日',
            'member_passwd' => '会员密码',
            'member_email' => '会员邮箱',
            'member_qq' => 'qq',
            'member_ww' => '阿里旺旺',
            'member_login_num' => '登录次数',
            'member_time' => '会员注册时间',
            'member_login_time' => '当前登录时间',
            'member_old_login_time' => '上次登录时间',
            'member_login_ip' => '当前登录ip',
            'member_old_login_ip' => '上次登录ip',
            'member_qqopenid' => 'qq互联id',
            'member_qqinfo' => 'qq账号相关信息',
            'member_sinaopenid' => '新浪微博登录id',
            'member_sinainfo' => '新浪账号相关信息序列化值',
            'member_points' => '会员积分',
            'available_predeposit' => '预存款可用金额',
            'freeze_predeposit' => '预存款冻结金额',
            'inform_allow' => '是否允许举报(1可以/2不可以)',
            'is_buy' => '会员是否有购买权限 1为开启 0为关闭',
            'is_allowtalk' => '会员是否有咨询和发送站内信的权限 1为开启 0为关闭',
            'member_state' => '会员的开启状态 1为开启 0为关闭',
            'member_credit' => '会员信用',
            'member_snsvisitnum' => 'sns空间访问次数',
            'member_areaid' => '地区ID',
            'member_cityid' => '城市ID',
            'member_provinceid' => '省份ID',
            'member_areainfo' => '地区内容',
            'member_privacy' => '隐私设定',
        ];
    }
}
